package com.po.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author zxw
 * @date 2020/7/28 21:09
 */
@Configuration
public class WebConfigure implements WebMvcConfigurer {
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowedMethods("GET")
                .allowedMethods("PUT")
                .allowedMethods("POST")
                .allowedMethods("OPTION");
    }
}
